choose an existing server不能选问题 您所在的位置:网站首页 eclipse项目没有run on server choose an existing server不能选问题

choose an existing server不能选问题

2023-09-13 11:51| 来源: 网络整理| 查看: 265

在创建PROJECT时选择一下版本,如果是tomcat6的话就选择2.5就行了

或者:在项目->右击->Properties->Project Facets->Modify Project  ->DynamicWeb Module 中改2.5

-----------------------------------------------------------------------------------

Cannot change version of project facet Dynamic web module to 2.5

解决方案:

我们用Eclipse创建Maven结构的web项目的时候选择了Artifact Id为maven-artchetype-webapp,由于这个catalog比较老,用的servlet还是2.3的,而一般现在至少都是2.5,在Project Facets里面修改Dynamic web module为2.5的时候就会出现Cannot change version of project facet Dynamic web module to 2.5,如图:

其实在右边可以看到改到2.5需要的条件以及有冲突的facets,解决这个问题的步骤如下:

1.把Servlet改成2.5,打开项目的web.xml,改之前:

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片         Archetype Created Web Application     Archetype Created Web Application

改后:

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片             Archetype Created Web Application     Archetype Created Web Application

2.修改项目的设置,在Navigator下打开项目.settings目录下的org.eclipse.jdt.core.prefs

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片 eclipse.preferences.version=1  org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5  org.eclipse.jdt.core.compiler.compliance=1.5  org.eclipse.jdt.core.compiler.problem.assertIdentifier=error  org.eclipse.jdt.core.compiler.problem.enumIdentifier=error  org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning  org.eclipse.jdt.core.compiler.source=1.5   eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.5 把1.5改成1.6

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片 eclipse.preferences.version=1  org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6  org.eclipse.jdt.core.compiler.compliance=1.6  org.eclipse.jdt.core.compiler.problem.assertIdentifier=error  org.eclipse.jdt.core.compiler.problem.enumIdentifier=error  org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning  org.eclipse.jdt.core.compiler.source=1.6   eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.6 3.打开org.eclipse.wst.common.component

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片                                                                                把 project-version="1.5.0"改成 project-version="1.6.0" [html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片                                                                                4.打开org.eclipse.wst.common.project.facet.core.xml

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片                        把改成,把  改成 

[html] view plain copy print ? 在CODE上查看代码片 派生到我的代码片                        都改好之后在打开看看,已经把Dynamic web module改成了2.5

好了,大功搞成,这是一种解决办法,但是治标不治本,更高级的就是自定义catalog,然后安装到本地,再创建的时候啥都有了,比如把现在流行的s(struts2)sh,ssi,s(springmvc)sh 创建catalog,包括包结构,部分代码啥的都有,下次写吧。

--------------------------------------------------------------------------------------------------------

Eclipse或STS中如何显示.setting等文件? 解决方案: 1.点击左上角的”小三角“,鼠标停在上面可以看见它叫”view menu“ 2.点击后,弹出的下拉菜单里选择”Filters“ 3.将.*resources前面的勾去掉,选择ok,这样配置完,就可以看见.setting和.classpath和.project如果用git管理项目,还可以看到.gitignore 4.上面3步骤基本就完成了,我们可以直接在这些文件里面改东西,例如改版本,当视图操作不成功的时候,不妨这里试试。 5.如果使用git作为项目管理工具,还可以看到.gitignore的文件,可以在这里配置不需要加入版本管理的文件。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有